<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="kines.ct.*"%>
<%
	int id_prospecto = request.getParameter("IdProspecto")!=null?Integer.parseInt(request.getParameter("IdProspecto")):-1;
	String NombreProspecto = request.getParameter("NombreProspecto")!=null?request.getParameter("NombreProspecto"):"";
%>
<html>
<head>
<title>Listado de Referidos</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="../css/arastyle.css" type="text/css">
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
<script language="javascript1.2">
	var pAgregarReferido = null;
	function AgregarReferido( idprospecto ){
		pAgregarReferido = window.open("AgregarReferidos.jsp?IdProspecto="+idprospecto,"AgregarReferidos_T","top=120,left=170,width=500,height=300,scrollbars=yes");
	}
</script>
</head>

<body class="fondo">
<br>
<table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <th colspan="4" scope="col" class="titulos">Listado de Personas Referidas</th>
  </tr>
  <tr>
    <td colspan="2" class="etiqueta">Nombre Prospecto:</td>
    <td colspan="2" bgcolor="#C2C2C2" >&nbsp;<%=NombreProspecto%></td>
  </tr>
  <tr class="titcolumna">
    <td width="6%"><div align="center">No<a href="#" onClick="AgregarReferido(<%=id_prospecto%>);"><img src="../images/icono_nuevo.gif" alt="Agregar Referido" width="11" height="11" border="0"></a></div></td>
    <td colspan="2"><div align="center">Nombre Referido</div></td>
    <td width="35%"><div align="center">Telefono</div></td>
  </tr>
  <%
  	Object [] referidos = Referred.getData( id_prospecto );
	int i = 0;
	if( referidos != null ){
		for( ; i < referidos.length; i++ ){
			Referred referido = (Referred)referidos[i];
  %>
  <tr>
    <td><div align="center"><%=(i+1)%></div></td>
    <td colspan="2"><div align="center"><%=referido.getFirstName()+" "+referido.getLastName()[0]+" "+referido.getLastName()[1]%></div></td>
    <td><div align="center"><%=referido.getPhone()%></div></td>
  </tr>
  <%
  		}
  	}
	if( i == 0 ){
  %>
  <tr>
    <td colspan="4"><div align="center">No hay Referidos de este Prospecto</div></td>
  </tr>
  <%
  	}
  %>
</table>
</body>
</html>
